package com.example.portal.model;

public class ResultEnum<T> {
    private Integer code;
    private String subCode;
    private String msg;
    private T data;
    public static ResultEnum INVALID_SINGTIMEOUT = new ResultEnum(1,"验证超时", null);
    public static ResultEnum INVALID_PERMISSION_DENIED =  new ResultEnum(1,"权限不足", null);
    public static ResultEnum OK = new ResultEnum();

    public ResultEnum() {
        this.code = 0;
        this.msg = "";
    }

    public ResultEnum(Integer code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public ResultEnum(Integer code, String subCode, String msg, T data) {
        this(code, msg, data);
        this.subCode = subCode;
    }

    public ResultEnum(T data) {
        this.code = 0;
        this.msg = "";
        this.data = data;
    }

    public Integer getCode() {
        return this.code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getSubCode() {
        return this.subCode;
    }

    public void setSubCode(String subCode) {
        this.subCode = subCode;
    }

    public String getMsg() {
        return this.msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return this.data;
    }

    public void setData(T data) {
        this.data = data;
    }
}